/*
 * Copyright (c) 2015 qunar. All Rights Reserved.
 */
package com.guoyu.project.model.enums;

import java.util.Map;

import com.google.common.collect.Maps;

/**
 * @author: libo Date: 15-6-7 Time: 下午5:43
 */
public enum ProgessCategory implements ArticleMinorType {

    /**
     * 全部
     */
    ALL(0, "全部"),
    /**
     * 综合性院校
     */
    COMPREHENSIVE(1, "综合性院校"),
    /**
     * 工科类院校
     */
    ENGINEERING(2, "工科类院校"),
    /**
     * 师范类院校
     */
    PEDAGOGICAL(3, "师范类院校"),
    /**
     * 财经管理类院校
     */
    FINANCE(4, "财经管理类院校"),
    /**
     * 农林医药类院校
     */
    MEDICINE(5, "农林医药类院校"),
    /**
     * 艺术类院校
     */
    ARTS(6, "艺术类院校"),

    ;

    private int code;
    private String desc;

    ProgessCategory(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getDesc() {
        return desc;
    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return this.name();
    }

    static Map<Integer, ProgessCategory> codeMapper = Maps.newHashMap();
    static {
        for (ProgessCategory newsType : values()) {
            codeMapper.put(newsType.getCode(), newsType);
        }
    }

    public static ProgessCategory codeOf(int code) {
        return codeMapper.get(code);
    }
}
